Assignemnt #89 and 88th program
Code
///Name: Derrick Andreasen
///Period: 7
///Program name: 88th Program
///File name: Eigh8prog.java
///Date Finished:1/14/2016
import java.util.Scanner;
import java.util.Random;
public class Eigh8prog
{
public static void main( String[] args )
{
Scanner kb = new Scanner(System.in);
Random r = new Random();
int a = 1 + r.nextInt(10), b = 1 + r.nextInt(10), c = a+b, x = 1 + r.nextInt(10), y = 1 + r.nextInt(10), z = x+y;
System.out.println( "Baby Blackjack!" );
System.out.println( "" );
System.out.println( "You drew " + a + " and " + b + "." );
System.out.println( "Your total is " + c + "." );
System.out.println( "" );
System.out.println( "The dealer has " + x + " and " + y + "." );
System.out.println( "Dealer's total is " + z + "." );
System.out.println( "" );
if(c > z)
{
System.out.println( "YOU WIN" );
}
else if(z > c)
{
System.out.println( "DEALER WINS" );
}
}
}
Picture of the output